---
layout: default
title: Archive
description: 众里寻他千百度 蓦然回首 那人却在 灯火阑珊处
header-img: "img/archive-bg.jpg"
---

<!--
Credits: this page shamelessly borrowed a lot from:
https://github.com/kitian616/jekyll-TeXt-theme
-->
<!-- Page Header -->
{% include intro-header.html type='page' short=true %}

<!-- Main Content -->
<div class="container">
    <div class="row">
        <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">

            <!-- 标签云 -->
            <div id='tag_cloud' class="tags tags-sup js-tags">
                <a class="tag-button--all" data-encode="">
                    Show All
                    <sup>{{site.posts.size}}</sup>
                </a>

                {% capture tags %}
                {% for tag in site.tags %}
                <a data-sort="{{ site.posts.size | minus: tag[1].size | prepend: '0000' | slice: -4, 4 }}"
                   data-encode="{{ tag[0] | strip | url_encode }}"
                   class="tag-button"
                   title="{{ tag[0] }}" rel="{{ tag[1].size }}">
                    {{ tag[0] }}
                    <sup>{{tag[1].size}}</sup>
                </a>
                {% endfor %}
                {% endcapture %}
                {{ tags | split:'<a>' | sort | join:'</a>' }}
            </div>

            <!-- 归档列表 -->
            <div class="mini-post-list js-result d-none">
                    {%- assign _sorted_list = site.posts -%}
                    {%- assign _sorted_list = _sorted_list | sort: 'date' -%}
                    {%- assign _sorted_list = _sorted_list | reverse -%}
                    {%- for _article in _sorted_list -%}
                    {%- assign _tags = '' -%}
                    {%- for _tag in _article.tags -%}
                    {%- assign _tag_encode = _tag | strip | url_encode -%}
                    {%- if forloop.last -%}
                    {%- assign _tags = _tags | append: _tag_encode -%}
                    {%- else -%}
                    {%- assign _tags = _tags | append: _tag_encode | append: ',' -%}
                    {%- endif -%}
                    {%- endfor -%}

                    {% comment %} group by year {% endcomment %}
                    {%- assign _currentyear = _article.date | date: '%Y' -%}
                    {%- assign _currentdate = _article.date | date: '%m-%d' -%}
                    {%- if _currentyear != _yaer -%}
                    {%- unless forloop.first -%}</section>{%- endunless -%}
                    <section>
                        <span class="fa fa-calendar-times-o listing-seperator">
                          <span class="tag-text">{{ _currentyear }}</span>
                        </span>
                    {%- assign _yaer = _currentyear -%}
                    {%- endif -%}
                    <div class="post-preview item" data-tags="{{ _tags }}">
                        <ul>
                            <li>
                                {{ _currentdate }}
                                <i class="fa fa-angle-double-right" aria-hidden="true"></i>
                                <a href="{{ _article.url | prepend: site.baseurl }}"
                                   style="color: #0085a1">
                                    <span>
                                     {{ _article.title }}
                                    </span>
                                </a>
                            </li>
                        </ul>
                    </div>
		    {%- if forloop.last -%}</section>{%- endif -%}
                    {% endfor %}
                </section>
            </div>
        </div>
    </div>
</div>
